package TypeInfo.StaticProxyDemo;

import java.util.Map;

/**
 * Created by IntelliJ IDEA
 * author：luyanfcp
 * email：lyhxbq@gmail.com
 * time:
 */
public class vehicleProxy implements vehicle{
    //委托对象
    private vehicle vehicle;
    //委托注入
    public vehicleProxy(vehicle vehicle) {
        this.vehicle=vehicle;
    }
    @Override
    public void run() {
        System.out.println("Proxy start....");
        vehicle.run();
        System.out.println("Proxy ending....");
    }
    public static void main(String[] args){
        vehicleProxy carProxy=new vehicleProxy(new car());
        vehicleProxy bicycleProxy=new vehicleProxy(new bicycle());
        carProxy.run();
        bicycleProxy.run();
    }

}
